package com.luojing.suanfa.digui;

/**
 * @author luojing
 * @create 2018/09/23 上午9:23
 **/
public class Feibonaqi {

  //输出i个斐波那契数列
  static int getFeibonaqi(int val){
    if(val == 0 || val == 1){
      return val;
    }else{
      int rs = (getFeibonaqi(val - 2) + getFeibonaqi( val - 1));
      return rs;
    }

  }

  public static void main(String[] args) {
    for(int i = 1;i <= 10;i++) {
      //调用函数进行打印
      System.out.print(getFeibonaqi(i) + "\t");
    }
  }
}
